<link rel="stylesheet" href="/Public/css/common/morris.css">
<style>
    .table>thead>tr>th{text-align: center;border-bottom:0}
    .table>tbody>tr>td{vertical-align: middle; text-align: center; border-top:0}
</style>
<div id="page-wrapper">
    <div class="row">
        <div class="col-lg-12">
            <h3 class="page-header">
                <span>数据统计</span>
            </h3>
        </div>
    </div>
    <div class="row">
        <div class="col-lg-12">
            <div class="panel panel-default">
                <div class="panel-heading">
                    <ul class="nav nav-tabs" id="myTab">
                        <li class="active"><a href="#tab1">总概</a></li>
                        <li><a href="/User/Niudan/statistics_date?id={$id}">最新数据</a></li>
                        <li><a href="/User/Niudan/statistics_user?id={$id}">用户行为</a></li>
                    </ul>
                </div>
                <div class="panel-body">
                    <div class="form-horizontal">
                        <input type="hidden" name="id" value="{$id}">
                        <div class="tab-content">
                            <div class="tab-pane active">
                                <div class="panel-body">
                                    <div id="graph-line"></div>
                                    <if condition="$count gt 1"><div style="float:right">时间（日）</div></if>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>
<script src="/Public/js/common/morris-chart/morris.js"></script>
<script src="/Public/js/common/morris-chart/raphael-min.js"></script>
<script>
    var data = {$list};
    var count = {$count};
    if(count >= 1){
        Morris.Line({
            element: 'graph-line',
            data: data,
            xkey: 'date',
            ykeys: ['pv', 'uv', 'wx_share'],
            labels: ['PV', 'UV', '转发量'],
            lineColors:['red','blue','grey'],
            parseTime: false
        });
    }
</script>